package com.itheima.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.itheima.pojo.Article;
import com.itheima.service.SinaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SinaController {

    @Autowired
    private SinaService service;

    @GetMapping("/search")
    public List<Article> findlike(String keywords){

        //调用Service去查找新闻
        List<Article> bywords = service.findBywords(keywords);

        return bywords;
    }
}
